<?php
/**
 * Base class for all modules.
 * You can add some init* functions to automatically be called when the module is loaded.
 * You can also add some initAdmin* functions to automatically be called when the module administration is loaded.
 */
class MModule {
    /**
     * @var MRequest
     */
    private static $_request;

    /**
     * @var MResponse
     */
    private static $_response;
    
    protected static $_version;
    
    public static function getVersion(){
        return static::$_version;
    }

    /**
     * Returns the current request
     * @return MRequest : Current request
     */
    public static function getRequest() {
        return self::$_request;
    }

    public static function setRequest($_request) {
        self::$_request = $_request;
    }

    /**
     * Returns the response
     * @return MResponse : Current response
     */
    public static function getResponse() {
        return self::$_response;
    }

    public static function setResponse($_response) {
        self::$_response = $_response;
    }
    
    public static function assign($name, $value){
        self::$_response->assignVar($name, $value);
    }
}
?>
